<template>
  <div class="pagebody">
    <StickHead></StickHead>
    <div class="inputbox mb25">
        <textarea type="text" class=" input_text fz28 borderbox "  v-model="flowContent" placeholder="请输入回复内容" ></textarea>
      </div>
      <div class="btn_div">
        <van-button class="btn" type="info" @click="addSchedule" >确定</van-button>
      </div>

  </div>
</template>

<script>
import StickHead from "@/layout/StickHead.vue";
import StickFoot from "@/layout/StickFoot.vue";
import { Toast } from "vant";
import { addSchedule } from "@/api/api";


export default {
  name: "reply",
  components: {
    StickHead,
    StickFoot,
  },
  data() {
    return {
      id: null,
      flowContent:"",
    };
  },

  created() {
    this.id = this.$route.params.id;
  },
  mounted() {
   
  },
  methods: {
    addSchedule() {
      if(null ==this.flowContent){
        Toast.fail("请填写回复内容！");
        return;
      }
      let params = {
        questionId: this.id,
        flowContent: this.flowContent,
      };
      addSchedule(params).then((response) => {
        if(response.data.code==200){
          Toast.success("保存成功！");
            this.$router.push("/");
        }else{
          Toast.fail("保存失败，请联系管理员！");
        }
      }
      
      );
    },
  },
};
</script>

<style lang="scss" scoped>
.pagebody {
  background-color: #f6f8fb;
  .inputbox{
    text-align: center;
    margin-top: 0.5rem;
    .input_text{
      width: 7rem;
    height: 3.5rem;
    max-width: 10rem;
    }
  }
  .btn_div{
    text-align: center;
    margin-top: -0.7rem;
    padding: 0.3rem 0;
  }
  .btn{
    padding: 0 1rem;
  }
  .btn1{
    padding: 0 1rem;
    margin-left: 0.5rem;
  }
}
</style>